#ifndef DRAWMARGINAPP_H
#define DRAWMARGINAPP_H

#include <QtGui/QMainWindow>
#include "ui_drawmarginapp.h"
#include "DrawAttribute.h"
#include "handleLine.h"
#include "ImageView.h"
#include <QTimer>
#include <QStandardItem>
#include <QStandardItemModel>
class handleLine;
using namespace std;

class DrawMarginApp : public QMainWindow
{
	Q_OBJECT

public:
	DrawMarginApp(QWidget *parent = 0, Qt::WFlags flags = 0);
	inline ImageView* getImageView(int id){return _imageView[id];}
	void setFishWidth(float width){ _width = width;}
	void setFishLength(float height) { _length = height;}
	void setMidLineLength(float midline) { _midlinelength = midline;}
	void setCrossLength(float corsslength){ _corsslenght = corsslength; }
	void updateInterFace();
	~DrawMarginApp();
public: signals:
	void signalExecute(void);

public slots:  
	void startExecute();
	void stopExecute();
	void startButtonClicked();
	void exitMainWindow();
	void imageWidth();
	void imageHeight();
	void inputPathSelect();
	void outputPathSelect();
	void reScene();
private:
	void stopButtonClicked();
	void initialize();
private:
	Ui::MainWindow ui;
	float _width,_length;
	float _midlinelength,_corsslenght;
	float _imageRealWidth,_imageRealHeight;
	handleLine* hLine;
	ImageView* _imageView[2];
	QTimer* _timer;
	QGraphicsScene* scene[2];
	QStandardItemModel* _itemModel;
};

#endif // DRAWMARGINAPP_H
